package com.component.swing;

import java.util.Map;


import javax.annotation.PostConstruct;
import javax.swing.JButton;

import javax.swing.JFrame;
import javax.swing.JPanel;

import javax.swing.JTextArea;

import org.apache.log4j.Logger;

import org.springframework.beans.factory.annotation.Autowired;
import com.component.swing.pannel.MainPannel;
import com.internal.system.System;


public class Frame extends JFrame{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	final static Logger log = Logger.getLogger(Frame.class);
	private String path;

	
	

	private JButton start;
	private JButton stop;
	private JPanel pannel;
	private JTextArea area;
	private Map<String, Object> component;
	
	@Autowired private System system;
	@Autowired private MainPannel main;
	
	public Frame(){
		this.setSize(500,300);
		
//		start = new JButton("Start");
//		stop = new JButton("Stop");
//		start.setSize(100,50);
//		stop.setSize(100,50);
//		
//		area = new JTextArea();
//		area.setFont(new Font("Serif", Font.ITALIC, 16));
//		area.setLineWrap(true);
//		area.setWrapStyleWord(true);
//		JScrollPane areaScrollPane = new JScrollPane(area);
//		areaScrollPane.setVerticalScrollBarPolicy(
//		                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
//		
//		
//		start.setName("Start");
//		stop.setName("Stop");
//		pannel = new JPanel(new BorderLayout());
//		
//		pannel.add(start,BorderLayout.EAST);
//		pannel.add(stop,BorderLayout.WEST);
//		
//		pannel.add(area,BorderLayout.CENTER);
		
		
//		this.add(pannel);
	}

	@PostConstruct
	public void setting(){
		this.add(main);
		system.add("frame", this);
//		component = new java.util.HashMap<String, Object>();
//		component.put("frame", this);
//		component.put("area", area);
//		mouse.setComponent(component);
//		mouse.setPath(path);
//		start.addMouseListener(mouse);
//		stop.addMouseListener(mouse);
	}
	
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

}
